<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" media="screen" href="main.css" />
    <script src="main.js"></script>
</head>
<body>
    <script>
            XHR = "";
            XHR = window.XMLHttpRequest ? new XMLHttpRequest() : new activexObjext("Microsoft.XMLHTTP");
            XHR.open("GET", "http://127.0.0.1/XML-study/css/css.xml", false);
            XHR.send();
            ResultXml=XHR.responseXML;  //返回一个对象一个
           document.write(ResultXml.getElementsByTagName("to")[0].childNodes[0].nodeValue);
            

            txt = "<bookstore><book>";
                txt = txt + "<title>Everyday Italian</title>";
                txt = txt + "<author>Giada De Laurentiis</author>";
                txt = txt + "<year>2005</year>";
                txt = txt + "</book></bookstore>";

                if (window.DOMParser) {
                    parser = new DOMParser();
                    xmlDoc = parser.parseFromString(txt, "text/xml");
                    alert(xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue);
                } else {
                    // Internet Explorer
                    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                    xmlDoc.async = false;
                    xmlDoc.loadXML(txt);
                }
    </script>
</body>
</html>